package com.bruceliu.service.impl;

import com.bruceliu.bean.Cart;
import com.bruceliu.mapper.CartMapper;
import com.bruceliu.service.CartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @BelongsProject: RestaurantSystem
 * @BelongsPackage: com.bruceliu.service.impl
 * @Author: bruceliu
 * @QQ:1241488705
 * @CreateTime: 2020-03-01 21:45
 * @Description: TODO
 */
@Service
public class CartServiceImpl implements CartService {

    @Resource
    CartMapper cartMapper;

    @Override
    public int addCart(Cart cart) {
        return cartMapper.addCart(cart);
    }

    @Override
    public int updateCart(Cart cart) {
        return cartMapper.updateCart(cart);
    }

    @Override
    public int deleteCart(int desk_id) {
        return cartMapper.deleteCart(desk_id);
    }

    @Override
    public int deleteCartById(int id) {
        return cartMapper.deleteCartById(id);
    }

    @Override
    public Cart getById(int id) {
        return cartMapper.getById(id);
    }

    @Override
    public int isExists(Map<String, Object> map) {
        return cartMapper.isExists(map);
    }

    @Override
    public Cart getMyCart(Map<String, Object> map) {
        return cartMapper.getMyCart(map);
    }

    @Override
    public List<Cart> getCarts(int desk_id) {
        return cartMapper.getCarts(desk_id);
    }
}
